' 
' Copyright (C) 2014 Infinity CCS Ltd (http://www.infinityccs.com/)
' Copyright (C) 2008 Sasa Coh <sasacoh@gmail.com>
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program.  If not, see <http://www.gnu.org/licenses/>. 
'/


Imports System
Imports System.Collections.Generic
Imports System.Text

Namespace Common.Timer
  ''' <summary>
  ''' Timer expiration callback
  ''' </summary>
  ''' <param name="sender"></param>
  ''' <param name="e"></param>
  Public Delegate Sub TimerExpiredCallback(sender As Object, e As EventArgs)

  ''' <summary>
  ''' Timer interface
  ''' </summary>
  Public Interface ITimer
    ''' <summary>
    ''' Request timer start
    ''' </summary>
    Function Start() As Boolean

    ''' <summary>
    ''' Request timer stop
    ''' </summary>
    Function [Stop]() As Boolean

    ''' <summary>
    ''' Set timer interval
    ''' </summary>
    Property Interval As Integer

    ''' <summary>
    ''' Set timer expiry callback method
    ''' </summary>
    WriteOnly Property Elapsed As TimerExpiredCallback

  End Interface
End Namespace